package com.oriental.manage.service.reserve;

import com.oriental.manage.core.paging.Pagination;
import com.oriental.manage.core.response.ResponseDTO;
import com.oriental.reserve.api.config.ReportReviewCfgInterface;
import com.oriental.reserve.model.ResponseModel;
import com.oriental.reserve.model.config.ReportReviewCfgDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Author: Yang xp
 * Date: 2017/5/19
 * Time: 10:10
 * Desc：
 */
@Service
@Slf4j
public class ReportReviewConfigService {

    @Autowired
    private ReportReviewCfgInterface reportReviewCfgInterface;

    public void search(Pagination<ReportReviewCfgDto> pagination, ReportReviewCfgDto accountTransTypeDto, ResponseDTO<Pagination<ReportReviewCfgDto>> responseDTO){
        ResponseModel<List<ReportReviewCfgDto>> responseModel = reportReviewCfgInterface.queryByModel(accountTransTypeDto);
        ReserveUtil.responseQueryHandle(responseModel,pagination,responseDTO,accountTransTypeDto,"查询成功");
    }

    public void update(ReportReviewCfgDto model, ResponseDTO<String> responseDTO){
        ResponseModel<String> responseModel = reportReviewCfgInterface.updateModel(model);
        ReserveUtil.responseHandle(responseModel,responseDTO,"修改成功");
    }


}
